/*******************************************************************************
 * Copyright (c) Jonathan Buck - jonbuck16@gmail.com
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    jonbuck16@gmail.com - initial API and implementation
 *******************************************************************************/
package net.jonbuck.tassoo.ui.view.provider;

import net.jonbuck.tassoo.model.Task;

import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.IFontDecorator;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;

/**
 * 
 * 
 * @since 1.0.0
 */
public class TaskModelDecorator implements ILabelDecorator, IFontDecorator {

	/**
	 * 
	 */
	public void addListener(ILabelProviderListener listener) {
	}

	/**
	 * 
	 */
	public void dispose() {
	}

	/**
	 * 
	 */
	public boolean isLabelProperty(Object element, String property) {
		return false;
	}

	/**
	 * 
	 */
	public void removeListener(ILabelProviderListener listener) {
	}

	/**
	 * 
	 */
	public Font decorateFont(Object element) {
		if (element instanceof Task) {
			Task entry = (Task) element;
			if (entry.getStatus().getAssociatedPercentage() == 100) {
				return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
			}
		}
		return null;
	}

	/**
	 * 
	 */
	public Image decorateImage(Image image, Object element) {
		return null;
	}

	/**
	 * 
	 */
	public String decorateText(String text, Object element) {
		return null;
	}

}
